package Game;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class TableValeursTest {
	TableValeurs test_table = null;

	@Before
	public void setUp() throws Exception {
		test_table = new TableValeurs();

	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void Deplacementtest() {
		assertTrue("deplacement Archer terre",
				test_table.getDeplacement(0, 0) == 1);
		assertTrue("deplacement Guerrier eau",
				test_table.getDeplacement(1, 2) == 0.5);
		assertTrue("deplacement Chevalier Montagne",
				test_table.getDeplacement(2, 1) == 0.5);
		assertTrue("deplacement Toruk Foret",
				test_table.getDeplacement(3, 3) == 0.5);
	}

	@Test
	public void AttaqueTest() {
		assertTrue("Archer vs Archer ", test_table.getUnitDamage(0, 0) == 1);
		assertTrue("Archer vs Guerrier ", test_table.getUnitDamage(0, 1) == 1);
		assertTrue("Archer vs Chevalier", test_table.getUnitDamage(0, 2) == 0.8);
		assertTrue("Archer vs Toruk ", test_table.getUnitDamage(0, 3) == 1.2);

	}

	@Test
	public void AttaqueTerrainTest() {
		assertTrue("Attaque Archer terre ", test_table.getTerrainDamage(0, 0) == 1);
		assertTrue("Attaque Guerrier eau",
				test_table.getTerrainDamage(1, 2) == 0.5);
		assertTrue("Attaque Chevalier Montagne",
				test_table.getTerrainDamage(2, 1) == 0.5);
		assertTrue("Attaque Toruk Foret", test_table.getTerrainDamage(3, 3) == 0.5);
		assertTrue("Attaque Toruk Lave", test_table.getTerrainDamage(3, 4) == 1);

	}

}
